# !usr/bin/env python
# -*- coding:utf-8 _*-
"""
@Author:张广勤
@Web site: https://www.tunan.wang
@Github:www.github.com
 
@File:xxqg01.py
@Time:2022/4/7 17:15

@Motto:不积跬步无以至千里，不积小流无以成江海！
"""
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
import time
opt = Options()
opt.add_experimental_option('excludeSwitches', ['enable-automation'])  # 关闭自动化提示
opt.add_argument("--start-maximized")  # 最大化
opt.add_argument('ignore-certificate-errors')  # 加上不出现私密连接
bro = webdriver.Chrome(r'C:\Users\hsk\Downloads\chromedriver_win32 (2)/chromedriver.exe', options=opt)

bro.get('https://www.xuexi.cn/')
bro.implicitly_wait(10)
#//*[@id="root"]/div/div[1]/header/div[2]/div[2]/a[2]
#用户登录
bro.find_element_by_xpath('//*[@id="root"]/div/div[1]/header/div[2]/div[2]/a[2]').click()
shuru=input("输入数据1开始：")
#学习慕课
bro.find_element_by_xpath('//*[@id="root"]/div/div[1]/header/div[2]/div[1]/div[1]/a[3]').click()
#time.sleep(3)
#/html/body/div/div/div[2]/section/div/div/div/div/div/section[2]/div/div/div/div[2]/div/section/div/div/div/div/div/div/div[1]/div[2]/div/div[2]/div/div/div/span/div
##root > div > div:nth-child(1) > header > div.menu > div.menu-list > div:nth-child(2) > a:nth-child(4)

bro.find_element_by_xpath('//*[@id="Zuo4cw0GaL"]/div/div/div/div/div/div/div/div[2]/div/div/div[6]/div/div/span').click()

